package com.qf.controller;

import com.qf.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

/**
 * @author zjw
 * @description
 * @date 2021/9/29$ 14:19$
 */
@Controller
public class UserController {

    @Autowired
    private UserService userService;

    /**
     * 转账操作
     * @param decrementUserId   被借钱人
     * @param incrementUserId   借钱人
     * @param money              借多少钱
     * @return
     */
    public String transferMoney(Integer decrementUserId,Integer incrementUserId,Integer money){
        //1. 参数校验，省略…………

        //2. 调用Service，完成转账
        String result = userService.transferMoney(decrementUserId,incrementUserId,money);

        //3. 返回成功失败
        return result;
    }

}
